package com.efuture.chapterthree

/* @Description:takeUnless的使用 跟takeIf正好相反
 * @Auther: zhaoshanshan
 * @Date: 2022/03/06/2:42 下午
 */
class demo49 {
    private var infoValue:String? = null

    fun getInfoValue()=infoValue;
    fun setInfovalue(infoValue:String){
        this.infoValue = infoValue;
    }


}

fun main() {
   //takeUnless 如果内置函数为true 则返回null;返回false 才取前面值
    val demo49 = demo49()
    //demo49.setInfovalue("zhaoshanshan")
    val r = demo49.getInfoValue().takeUnless { it.isNullOrBlank()}?:"未经过任何初始化"
    println(r)

}